-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage optimization #274
Merged
Merged
Storage optimization #274
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[jacodb-core] Add de-duplication of attribute values in AttributesImmutable As of this commit, values array contains only different attribute values. [jacodb-core] Close ers iff it was initialized [jacodb-core] Processed only jar files referenced in the Class-Path attribute of manifest [jacodb-storage] Fix minor memory usage issue in AttributesImmutable Avoid using class constructor parameters in lazy fields. [jacodb-storage] Reduce memory usage by InstanceIdCollections In this commit, two implementation of InstanceIdCollection added, SortedIntArrayInstanceIdCollection & UnsortedIntArrayInstanceIdCollection. If instances ids of particular attributes cannot be packed in a LongRange, but if they all can be represented as an Int, then corresponding implementations wrap IntArray, not LongArray. [jacodb-storage] Minor: toAttributesImmutable() is an extension for list of attribute pairs [jacodb-storage] Optimize AttributesImmutable.navigate() in case of sorted by value attributes If attributes are sorted by value, in binary search algorithm, getting instance id by index of an attribute value can be skipped. In that case, copying of the attribute value in an extra byte array is redundant, and comparing can be done by a special comparison function. [jacodb-storage] Re-order built-in bindings [jacodb-storage] Optimize dealing with instance ids in AttributesImmutable Instead of LongArray, instance ids are represented by implementors of InstanceIdCollection. LongRangeInstanceIdCollection saves memory by using LongRange instead of LongArray. The getByIndex() method introduced and used where possible in order to skip conversion of instance id to index in InstanceIdCollection to load values from values byte array. [jacodb-benchmarks] Make RAMEntityRelationshipStorageBenchmarks more correct Fewer operations on each invocation, this reduces Java GC load. [jacodb-storage] Optimize PropertiesMutable.getEntitiesLtValue() & PropertiesMutable.getEntitiesEqOrLtValue() Minor optimization: exit iteration over value index earlier. This is okay since all further values are greater than specified one. [jacodb-benchmarks] Add benchmarks of RAM implementation of ERS API [jacodb-storage] Get rid of using one-nio library ByteArrayBuilder added instead of one-nio's one. SparseBitSet moved to the 'org.jacodb.util.collections' package.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## neo #274 +/- ##
============================================
- Coverage 59.29% 59.22% -0.07%
- Complexity 2601 2608 +7
============================================
Files 319 320 +1
Lines 19067 19144 +77
Branches 2823 2845 +22
============================================
+ Hits 11305 11338 +33
- Misses 6676 6710 +34
- Partials 1086 1096 +10 ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[jacodb-core] Add de-duplication of attribute values in AttributesImmutable
As of this commit, values array contains only different attribute values.
[jacodb-core] Close ers iff it was initialized
[jacodb-core] Processed only jar files referenced in the Class-Path attribute of manifest
[jacodb-storage] Fix minor memory usage issue in AttributesImmutable
Avoid using class constructor parameters in lazy fields.
[jacodb-storage] Reduce memory usage by InstanceIdCollections
In this commit, two implementation of InstanceIdCollection added, SortedIntArrayInstanceIdCollection & UnsortedIntArrayInstanceIdCollection. If instances ids of particular attributes cannot be packed in a LongRange, but if they all can be represented as an Int, then corresponding implementations wrap IntArray, not LongArray.
[jacodb-storage] Minor: toAttributesImmutable() is an extension for list of attribute pairs
[jacodb-storage] Optimize AttributesImmutable.navigate() in case of sorted by value attributes
If attributes are sorted by value, in binary search algorithm, getting instance id by index of an attribute value can be skipped. In that case, copying of the attribute value in an extra byte array is redundant, and comparing can be done by a special comparison function.
[jacodb-storage] Re-order built-in bindings
[jacodb-storage] Optimize dealing with instance ids in AttributesImmutable
Instead of LongArray, instance ids are represented by implementors of InstanceIdCollection. LongRangeInstanceIdCollection saves memory by using LongRange instead of LongArray. The getByIndex() method introduced and used where possible in order to skip conversion of instance id to index in InstanceIdCollection to load values from values byte array.
[jacodb-benchmarks] Make RAMEntityRelationshipStorageBenchmarks more correct
Fewer operations on each invocation, this reduces Java GC load.
[jacodb-storage] Optimize PropertiesMutable.getEntitiesLtValue() & PropertiesMutable.getEntitiesEqOrLtValue()
Minor optimization: exit iteration over value index earlier. This is okay since all further values are greater than specified one.
[jacodb-benchmarks] Add benchmarks of RAM implementation of ERS API
[jacodb-storage] Get rid of using one-nio library
ByteArrayBuilder added instead of one-nio's one.
SparseBitSet moved to the 'org.jacodb.util.collections' package.